package cn.healthlink.proxy.demo04;

import cn.healthlink.proxy.Teacher;
import cn.healthlink.proxy.TeacherImpl;

/**
 * @author dengzhiyuan
 * @version 1.0
 * @time 2021/2/24 15:28
 */
public class Main {

	public static void main(String[] args) {
		Teacher teacher = new TeacherImpl();
		JdkDynamicProxy jdkDynamicProxy = new JdkDynamicProxy(teacher);
		jdkDynamicProxy.addInterceptorList(new OneMethodInterceptor());
		jdkDynamicProxy.addInterceptorList(new TwoMethodInterceptor());
		System.out.println("_________________________________________");
		//获取代理对象
		Teacher proxyTeacher = (Teacher) jdkDynamicProxy.getProxy();
		proxyTeacher.sayHello("dzy");
	}

}
